﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Tradex.Market;

namespace Tradex.Trading {

    /// <summary>
    /// This is a trigger for an order. Triggers are used to keep roders formant until the trigger condition 
    /// has been fullfilled.
    /// </summary>
    public class Trigger {

        /// <summary>
        /// Public constructor for the Trigger.
        /// </summary>
        /// <param name="instrument"></param>
        /// <param name="price"></param>
        /// <param name="priceType"></param>
        public Trigger(InstrumentKey instrument, double price, TriggerPriceType priceType) {
            Instrument = instrument;
            Price = price;
            PriceType = priceType;
        }

        /// <summary>
        /// This is the trigger instrument. If set, this allows a trigger to be defined on another instrument than
        /// the actual order is then executed.
        /// </summary>
        public InstrumentKey Instrument { get; private set; }

        /// <summary>
        /// This is the trigger price.
        /// </summary>
        public double Price { get; private set; }

        /// <summary>
        /// This is the trigger price type.
        /// </summary>
        public TriggerPriceType PriceType { get; private set; }

    }

}
